import request from '@/axios'
import type { ListParams, Response } from '@/api/api'

export interface Row {
  id: number
  no: string
  amount: string
  quantity: number
  orderDetail: []
  user: {}
}

export interface FormData {
  id?: number
  no: string
  amount: string
  quantity: number
  orderDetail: []
  user: {}
}
// 订单列表
export const getListApi = (data: ListParams): Promise<Response<Row>> => {
  return request.post({ url: '/order/list', data })
}
// 订单列表详情
export const modifyUserApi = (data: Partial<FormData>): Promise<IResponse> => {
  return request.post({ url: '/order/details', data })
}
// 订单列表删除
export const delUserApi = (data: { id: string }): Promise<IResponse> => {
  return request.post({ url: '/order/del', data })
}

// 用户列表
export const getSelectListApi = (data: ListParams): Promise<Response<Row>> => {
  return request.post({ url: '/select/user', data })
}
